from hyx import print_out
from command import Command

commands = {"Q": Command.exitCommand(), "C": Command.choseCommand(), "R": Command.resetCommand(), "B": Command.backCommand()}

class UserInterface:



  def show(self, state):
    s = []
    d = []
    for piece in state.pieces:
      s.append((piece.y, piece.x))
      d.append((piece.h, piece.w, piece.name))
    print_out(s, d)

  def getInputs(self):
    return input()

  def showResult(self, result = True):
    if result:
      print("恭喜你，通关成功！")
    else:
      print("很遗憾，通关失败！")

  def askLevel(self, levels):
    print("请选择关卡：")
    for i in range(len(levels)):
      print(f"{i}: {levels[i][0]}")
    print("输入编号：", end = "")
    return int(input())

  def askCommand(self, history):
    print(f"当前已移动：{len(history)}步")
    next_num = input("请输入您想移动的棋子编号：（如想退出，请输入Q；如想回到上一步，请输入B；如想重置，请输入R；如想回到选关界面，请输入C）")
